package cn.wolfcode.trip.base.domain;


import cn.wolfcode.trip.base.util.JSONUtil;

import lombok.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Getter@Setter@ToString@AllArgsConstructor
@NoArgsConstructor
public class User extends  BaseDomain{
    public static final Integer GENDER_SECRET =-1;
    public static final Integer GENDER_MAN =0;
    public static final Integer GENDER_WOMAN =1;

    private String email;

    private String nickName;

    private String password;

    private String place;

    private String headImgUrl;

    private Integer gender;

    private String coverImgUrl;

    private String sign;

    //粉丝数 qyq
    private Integer fans;
    //关注数 qyq
    private Integer attention;

    private FriendshipPraise praise;
    private PrivateMessage message;


    public String getGenderName(){
        String genderName="保密";
      /*  switch (gender){
            case 0:genderName="男";
            case 1:genderName="女";
            default:genderName="保密";
        }*/
        if (gender==GENDER_MAN) {
            genderName="男";
        }else {
            genderName="女";
        }

        return genderName;
    }

    public Object getJson(){
        Map<String,Object> map = new HashMap<>();
            map.put("userId",id);
            map.put("userName",nickName);
        if (praise != null) {
            map.put("praiseId",praise.id);
        }
        return JSONUtil.toJSONString(map);
    }

}